#ifndef UL_TASK_QUEUE_H_ 
#define UL_TASK_QUEUE_H_
#include "ul_define.h"
namespace LinuxNetworkUtility
{
  class UlMultiProducerSingleConsumerTskQueue
  {
  public:
    UlMultiProducerSingleConsumerTskQueue()
    {
    }
    virtual ~UlMultiProducerSingleConsumerTskQueue()
    {
    }

    virtual int init(const int64_t producer_num) = 0;
    virtual int push(const void *tsk, const int64_t producer_id) = 0;
    /// return #tsk poped, <0 for error
    virtual int pop(void ** tsk, const int64_t ntsk, const int64_t timeout_us) = 0;
  };

  class UlQueenWorkerTskQueue
  {
  public:
    UlQueenWorkerTskQueue()
    {
    }
    virtual ~UlQueenWorkerTskQueue()
    {
    }
    virtual int init(const int64_t worker_bee_num) = 0;
    /// the queen bee dispatch task to worker bees
    virtual int dispatch_task(void *tsk) = 0;
    /// the worker bee claim task to do
    virtual int claim_task(void **tsk, const int64_t ntsk, const int64_t timeout_us, 
                           const int64_t worker_id) = 0;
    /// the worker bee submit output of task
    virtual int submit_output(void *tsk, const int64_t worker_id) = 0;
    /// the queen bee fetch output of tasks
    virtual int fetch_output(void **tsk, const int64_t ntsk, const int64_t timeout_us) = 0;
  private:
  };
}
#endif /* UL_TASK_QUEUE_H_ */
